package com.haidechizi.leetcode;

/**
 * @author: wangdejun
 * @create: 2020-04-14 12:13
 **/
public class _367_有效的完全平方数 {

    public boolean isPerfectSquare(int num) {
        if (num == 1 || num == 0) {
            return true;
        }
        int middle = num / 2 + 1;
        for (int i = 1; i <= middle; i++) {
            if(i*i == num) {
                return true;
            }
        }
        return false;
    }
}
